﻿<MSimpleTable Dense>
    <thead>
        <tr>
            <th class="text-left">
                Name
            </th>
            <th class="text-left">
                Calories
            </th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in _desserts)
        {
            <tr @key="item.Name">
                <td>@item.Name</td>
                <td>@item.Calories</td>
            </tr>
        }
    </tbody>
</MSimpleTable>

@code {
    public class Dessert
    {
        public string Name { get; set; }

        public int Calories { get; set; }
    }

    private List<Dessert> _desserts = new List<Dessert>
        {
           new Dessert {
            Name= "Frozen Yogurt",
            Calories= 159,
          },
          new Dessert{
            Name= "Ice cream sandwich",
            Calories= 237,
          },
          new Dessert {
            Name= "Eclair",
            Calories= 262,
          },
          new Dessert {
            Name= "Cupcake",
            Calories= 305,
          },
          new Dessert {
            Name= "Gingerbread",
            Calories= 356,
          },
          new Dessert {
            Name= "Jelly bean",
            Calories= 375,
          },
          new Dessert {
            Name= "Lollipop",
            Calories= 392,
          },
          new Dessert {
            Name= "Honeycomb",
            Calories= 408,
          },
          new Dessert {
            Name= "Donut",
            Calories= 452,
          },
          new Dessert {
            Name= "KitKat",
            Calories= 518,
          },
        };
}

